package com.biz.primus.ms.adv.trans;

import com.biz.primus.model.adv.vo.AdPositionVo;
import com.biz.primus.ms.adv.dao.po.AdPosition;
import com.google.common.base.Function;

/**
 * @author jun.liu
 * @date 2017/9/18
 */
public class AdPositionVo2AdPosition implements Function<AdPositionVo, AdPosition> {

    @Override
    public AdPosition apply(AdPositionVo input) {
        AdPosition po = new AdPosition();
        if (input.getId() != null && !"".equals(input.getId().trim())) {
            po.setId(Long.parseLong(input.getId()));
        }
        po.setName(input.getName());
        po.setWidth(input.getWidth());
        po.setHeight(input.getHeight());
        po.setDescription(input.getDescription());
        po.setUseType(input.getUseType());
        po.setInvalid(input.isInvalid());
        po.setAdUsePlace(input.getAdUsePlace());
        return po;
    }
}